//package com.cskaoyan.service.wx.wxy;
//
//import com.cskaoyan.controller.wx.wxy.OrderUtils;
//import com.cskaoyan.mapper.MarketAftersaleMapper;
//import com.cskaoyan.mapper.MarketOrderGoodsMapper;
//import com.cskaoyan.mapper.MarketOrderMapper;
//import com.cskaoyan.module.bean.vo.WxOrderListVo;
//import com.cskaoyan.module.pojo.*;
//import com.cskaoyan.module.vo.wx.wxy.AftersaleDetailDataVo;
//import com.cskaoyan.module.vo.wx.wxy.WxAftersaelDataListVo;
//import com.cskaoyan.module.vo.wx.wxy.WxAftersaleDataVo;
//import com.github.pagehelper.PageHelper;
//import com.github.pagehelper.PageInfo;
//import org.apache.shiro.SecurityUtils;
//import org.apache.shiro.subject.Subject;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Service;
//
//import java.math.BigDecimal;
//import java.text.ParseException;
//import java.text.SimpleDateFormat;
//import java.util.ArrayList;
//import java.util.Date;
//import java.util.List;
//
//@Service
//public class MarketAftersaleServiceImpl implements MarketAftersaleService {
//
//    @Autowired
//    MarketOrderMapper orderMapper;
//    @Autowired
//    MarketOrderGoodsMapper orderGoodsMapper;
//    @Autowired
//    MarketAftersaleMapper aftersaleMapper;
//
//
//
//
//    @Override
//    public WxAftersaleDataVo selectAftersale(Short status, Integer page, Integer limit) {
//
//        List<WxAftersaelDataListVo> list = new ArrayList<>();
//
//        Subject subject = SecurityUtils.getSubject();
//        MarketUser user = (MarketUser)subject.getPrincipals().getPrimaryPrincipal();
//
//
//        MarketAftersaleExample marketAftersaleExample = new MarketAftersaleExample();
//        MarketAftersaleExample.Criteria criteria1 = marketAftersaleExample.createCriteria();
//        criteria1.andUserIdEqualTo(user.getId()).andStatusEqualTo(status);
//        List<MarketAftersale> marketAftersales = aftersaleMapper.selectByExample(marketAftersaleExample);
//
//        for (MarketAftersale marketAftersale : marketAftersales) {
//            MarketOrderGoodsExample orderGoodsExample = new MarketOrderGoodsExample();
//            MarketOrderGoodsExample.Criteria criteria = orderGoodsExample.createCriteria();
//            criteria.andOrderIdEqualTo(marketAftersale.getOrderId());
//            List<MarketOrderGoods> marketOrderGoods = orderGoodsMapper.selectByExample(orderGoodsExample);
//
//            WxAftersaelDataListVo wxAftersaelDataListVo = new WxAftersaelDataListVo();
//            wxAftersaelDataListVo.setAftersale(marketAftersale);
//            wxAftersaelDataListVo.setGoodsList(marketOrderGoods);
//            list.add(wxAftersaelDataListVo);
//        }
//
//        PageHelper.startPage(page, limit);
//        PageInfo<WxAftersaelDataListVo> pageInfo = new PageInfo<>(list);
//        //list.size() !一定= total   → total ≥ list.size()
//        long total = pageInfo.getTotal();//拿到满足条件的总的数据量（不考虑分页）
//        int pages = pageInfo.getPages();
//
//        return WxAftersaleDataVo.data(total,pages,limit,page,list);
//    }
//}
//
//
//
//
